/*
 * Copyright (C) 2010-2011 Graz University of Technology, Austria. All Rights reserved. 
 *
 * Contact: Simone Kopeinik <simone.kopeinik@tugraz.at>
 * 	   Graz University of Technology, Knowledge Management Institute, Brückenkopfgasse 1/6, 8020 Graz 	
 * 	   <http://www.kmi.tugraz.at/>
 * 
 * This software is part of the TARGET platform developed by the
 * TARGET EC-funded project www.reachyourtarget.org
 *
 * This software is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * The GNU General Public License is available at <http://www.gnu.org/licenses/>.
 *
 */
package at.tugraz.kmi.css.cbkst2;

import com.google.common.collect.ImmutableSet;

/**
 * Immutable interface of a {@link PrerequesiteOrderSet}.
 * 
 * @author Georg Öttl
 * 
 * 
 * @param <V>
 *            Either a {@link CbKSTCompetence} or a {@link CbKSTCompetence}
 */
public interface ImmutablePrerequesiteOrderSet<V extends CbKSTVertex> {

	/**
	 * @param vertex
	 * @return true if this knowledge structure contains the vertex.
	 */
	boolean contains(V vertex);

	/**
	 * 
	 * @return a count of existing elements in this structure.
	 */
	int size();

	/**
	 * finds a CbKST vertex based on a String ID.
	 * 
	 * @param id
	 *            The id of a vertex
	 * @return the related objet
	 */
	V find(String id);

	/**
	 * 
	 * @param pr
	 *            The relation to look for.
	 * @return True if this relation is contained in the structure.
	 */
	boolean containsPrerequesite(PrerequesiteRelation pr);

	/**
	 * 
	 * @param vertex
	 *            The vertex we are looking prerequisites for.
	 * @return A Set of prerequisites for the vertex.
	 */
	ImmutableSet<V> getPrerequisites(V vertex);

	/**
	 * 
	 * @param vertex
	 *            The vertex we are looking for the descendants.
	 * @return A set of descendants of the vertex.
	 */
	ImmutableSet<V> getDescendants(V vertex);

	/**
	 * @return All Prerequisites.
	 */
	ImmutableSet<PrerequesiteRelation> getPrerequisites();

	/**
	 * @return A set of all contained Vertices.
	 */
	ImmutableSet<V> getCbKSTVertices();

}